<template>
	<view class="container">
		<view class="tab-box">
			<view class="tab-item" @tap="tapItem" data-index="0">
				<view class="item-label" :class="{'item-label-active': isShowBox[0]}">收入记录</view>
				<view class="item-line" :class="{'item-line-active': isShowBox[0]}"></view>
			</view>
			<view class="tab-item" @tap="tapItem" data-index="1">
				<view class="item-label" :class="{'item-label-active': isShowBox[1]}">提现记录</view>
				<view class="item-line" :class="{'item-line-active': isShowBox[1]}"></view>
			</view>
		</view>
		<view class="income-box" v-show="isShowBox[0]">
			<view class="income-item-box" v-for="(item,index) in incomeList" :key="index">
				<view class="income-item">
					<image class="income-icon" src="../../static/images/money.png"></image>
					<view class="item-date">2020-08-06</view>
					<view class="item-money">+600.00</view>
				</view>
				<view class="income-item-line"></view>
			</view>
		</view>
		<view class="withdraw-box" v-show="isShowBox[1]">
			<view class="withdraw-item" v-for="(item,index) in withdrawList" :key="index">
				<view class="money-box">
					<view class="money-label">已提现</view>
					<view class="money-num">3000.00</view>
				</view>
				<view class="info-box">
					<view class="info-item">
						<view class="info-label">提现时间</view>
						<view class="info-content">2020-08-10</view>
					</view>
					<view class="info-item">
						<view class="info-label">提现方式</view>
						<view class="info-content">招商银行卡</view>
					</view>
				</view>
			</view>
		</view>
		<view class="balance-box">
			<view class="balance-info">
				可提现余额：<view class="balance-num">3000.00</view>
			</view>
			<view class="withdraw-btn" @tap="goWithdraw">提现</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				curIndex: 0,
				isShowBox: [true, false],
				incomeList: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14],
				withdrawList: [1, 2, 3, 4, 5, 6]
			}
		},
		
		methods: {
			
			tapItem(e) {
				this.isShowBox[this.curIndex] = false
				this.curIndex = e.currentTarget.dataset.index
				this.isShowBox[this.curIndex] = true
			},
			
			goWithdraw() {
				uni.navigateTo({
					url: '/pages/withdraw/withdraw'
				})
			}
			
		}
	}
</script>

<style>
	page {
		color: #333333;
		background-color: #eeeeee;
	}
	
	.container {
		width: 750rpx;
		height: auto;
	}
	
	.tab-box {
		width: 750rpx;
		height: auto;
		background-color: #ffffff;
		display: flex;
		flex-direction: row;
		padding-top: 30rpx;
	}
	
	.tab-item {
		width: 375rpx;
	}
	
	.item-line {
		width: 56rpx;
		height: 2rpx;
		background-color: #ffffff;
		margin-top: 20rpx;
	}
	
	.item-line-active {
		background-color: #5683ec;
	}
	
	.item-label {
		font-size: 28rpx;
		color: #333333;
	}
	
	.item-label-active {
		color: #5683ec;
	}
	
	.tab-item {
		display: flex;
		flex-direction: column;
		align-items: center;
	}
	
	.income-box {
		width: 750rpx;
		height: auto;
		background-color: #ffffff;
		margin-top: 20rpx;
		padding-bottom: 96rpx;
	}
	
	.income-item-box {
		width: 730rpx;
		height: auto;
		padding-top: 30rpx;
	}
	
	.income-item {
		width: 100%;
		display: flex;
		flex-direction: row;
		align-items: center;
	}
	
	.income-item-line {
		width: 700rpx;
		height: 2rpx;
		background-color: #f5f5f5;
		margin-top: 30rpx;
		margin-left: 30rpx;
	}
	
	.income-icon {
		width: 64rpx;
		height: 64rpx;
		margin-left: 30rpx;
	}
	
	.item-date {
		font-size: 24rpx;
		color: #666666;
		margin-left: 40rpx;
	}
	
	.item-money {
		font-size: 28rpx;
		color: #fa4607;
		margin-left: 350rpx;
	}
	
	.balance-box {
		position: fixed;
		left: 0;
		bottom: 0;
		width: 750rpx;
		height: 96rpx;
		background-color: #ffffff;
		display: flex;
		flex-direction: row;
		align-items: center;
	}
	
	.balance-info {
		font-size: 24rpx;
		color: #333333;
		margin-left: 40rpx;
	}
	
	.balance-num {
		font-size: 32rpx;
		color: #fa4607;
		display: inline-block;
	}
	
	.withdraw-btn {
		width: 234rpx;
		height: 72rpx;
		background-color: #5683ec;
		border-radius: 36rpx;
		color: #ffffff;
		font-size: 30rpx;
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
		margin-left: 190rpx;
	}
	
	.withdraw-box {
		width: 750rpx;
		height: auto;
		margin-top: 20rpx;
		padding-bottom: 96rpx;
	}
	
	.withdraw-item {
		width: 750rpx;
		height: auto;
		display: flex;
		flex-direction: column;
		align-items: center;
		background-color: #ffffff;
		margin-bottom: 30rpx;
	}
	
	.money-box {
		width: 670rpx;
		height: auto;
		display: flex;
		flex-direction: column;
		align-items: center;
		padding-top: 30rpx;
		padding-bottom: 30rpx;
		border-bottom: solid 2rpx #f5f5f5;
	}
	
	.money-label {
		color: #333333;
		font-size: 24rpx;
	}
	
	.money-num {
		color: #5683ec;
		font-size: 36rpx;
		margin-top: 10rpx;
	}
	
	.info-box {
		width: 670rpx;
	}
	
	.info-item {
		width: 100%;
		height: 60rpx;
		display: flex;
		flex-direction: row;
		justify-content: space-between;
		align-items: center;
	}
	
	.info-label {
		color: #666666;
		font-size: 24rpx;
	}
	
	.info-content {
		color: #666666;
		font-size: 24rpx;
	}
</style>
